package chpt06;

import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;

public class TreeSetDemo02 {

	public static void main(String[] args) {
		Set<StudentV1> students = new TreeSet<>();
		students.add(new StudentV1("abx",18));
		students.add(new StudentV1("abc",20));
		students.add(new StudentV1("bax",17));
        Iterator<StudentV1> iter = students.iterator();
        while(iter.hasNext()) {
        	System.out.println(iter.next());
        }       
	}
}
